import Vue from 'vue'

// 注册一个全局自定义指令 `v-auth`
Vue.directive('auth', {
    // 当被绑定的元素插入到 DOM 中时……
    inserted: (el, binding, vnode) => {
        const value = binding.value;
        // const auths = localStorage.getItem('ms_userInfo').userAuth || '';
        let adminStr = localStorage.getItem("ms_userInfo");
        let admin = JSON.parse(adminStr);
        let level=admin.value.userAuth;
        if (level > '0') {
            el.parentNode.removeChild(el);
        }
    }
});
